package com.gitee.T2;

import java.util.Scanner;

public class t2 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.print("输入n和target：");
        int n = sc.nextInt();
        int target = sc.nextInt();
        int[] arr = new int[n];
        System.out.println("输入数组：");
        for (int i = 0; i < n; i++) {
            arr[i] = sc.nextInt();
        }
        boolean flag = false;
        for (int i = 0; i < n; i++) {
            for (int j = i + 1; j < n; j++) {
                if (arr[i] + arr[j] == target) {
                    flag = true;
                    System.out.println("[" + i + "," + j + "]");
                }
            }
        }
        if (!flag) {
            System.out.println("不存在");
        }
    }
}
